package com.bwt.top.bwt_ad_flutter.util;

import android.annotation.SuppressLint;
import android.util.Log;

import java.text.SimpleDateFormat;
import java.util.Date;

public class LogUtil {
    private static final String TAG = "BwtAdFlutterPlugin -> ";
    private static boolean isNeedLog = true;

    public static void setIsNeedLog(boolean isNeedLog) {
        LogUtil.isNeedLog = isNeedLog;
    }

    @SuppressLint("SimpleDateFormat")
    public static void log(String log) {
        if (isNeedLog) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
            String time = sdf.format(new Date());
            Log.d(TAG, time + " -> " + log);
        }
    }
}
